package com.doit.spark.day03

import com.doit.spark.day01.utils.SparkUtil
import org.apache.spark.rdd.RDD

/**
 * @DATE 2022/1/5/10:23
 * @Author MDK
 * @Version 2021.2.2
 * */
object C02_Glom {
  def main(args: Array[String]): Unit = {
    val sc = SparkUtil.getSc
    val rdd: RDD[Int] = sc.parallelize(List[Int](1, 2, 3, 4, 5, 6), 2)
    val rdd2 = rdd.glom()
    val rdd3 = rdd2.map(arr => arr.toList)
    rdd3.foreach(println)
  }
}
